
use "Data0007.dta"



* Generation of sampling districts variables for merging*

generate sampling_district_1971=.

replace sampling_district_1971=1 if v390<2000

replace sampling_district_1971=2 if v390> 1999 & v390<3000

replace sampling_district_1971=3 if v390> 2999 & v390<4000


replace sampling_district_1971=4 if v390> 3999 & v390<5000

replace sampling_district_1971=6 if v390==5000

replace sampling_district_1971=5 if v390> 5000 & v390<6000

replace sampling_district_1971=7 if v390> 6000 & v390<7000


replace sampling_district_1971=8 if v390> 7000 & v390<7500

replace sampling_district_1971=10 if v390> 7999 & v390<8100

replace sampling_district_1971=9 if v390> 8100 & v390<9000

replace sampling_district_1971=12 if v390==9000

replace sampling_district_1971=11 if v390> 9000 


*age squared*
generate agesquared=   v439^2


*Merging with refugeees and occupation data*
merge m:1  sampling_district_1971  using "occupationdata.dta"


*Generation of themometer variable: Germans*

generate tem_germans= v378 
replace tem_germans=v378*-1+200  if v378>100



*Table 5: Attitudes towards Germans and German Terror*
sum tem_germans  terror_index v439  v395 v23 v30 v11

reg tem_germans  terror_index, cluster ( sampling_district_1971)
reg tem_germans c.terror_index v439  v395 i.v23 v30 v11 , cluster ( sampling_district_1971)

reg tem_germans c.terror_index##c.v439 , cluster ( sampling_district_1971)

reg tem_germans c.terror_index##c.v439  v395 i.v23 v30 v11 , cluster ( sampling_district_1971)



*Table 6: Attitudes towards Germans and EEC membership*

reg v202 tem_germans, r 

reg  v202 tem_germans v439  v395 i.v23 v30 v11 , r

